
import glob
import re
import string
import pepe.p_txt.bigtxt as bt

n = '\x0D\x0A'

if 1:
    o = open('gl0.dat', 'wb')
    d = open('trash_of.dat', 'wb')
    #o.write('...' + crlf)
    
    for inpfile in glob.glob('*.txt'):
        for line in bt.lines(inpfile):  
            line = re.sub(n, '', line)       

            if re.search('\d{7}', line[:7]) and len(line.split('	')) == 24:
                o.write(inpfile[:13] + '	' + line + n)
            else:
                d.write(inpfile[:13] + '	' + line + n)
    o.close()
    d.close()
